package com.bwie.remote.fallback;

import com.bwie.common.domain.GlobalStatusEnum;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.remote.RemoteSysUserService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author <a href="mailto:3364114353@qq.com">liuwenliang</a>
 * @version 1.0
 * @description:
 * @date 2025/9/9 10:28
 */
@Component
public class RemoteSysUserServiceFallback implements FallbackFactory<RemoteSysUserService> {
    @Override
    public RemoteSysUserService create(Throwable cause) {
        return new RemoteSysUserService() {
            @Override
            public Result<User> selectPhoneIsExist(String phone) {
                return Result.error(GlobalStatusEnum.SYSTEM_IS_BUSY.getLabel());
            }

            @Override
            public Result addSmsRecord(User user) {
                return Result.error(GlobalStatusEnum.SYSTEM_IS_BUSY.getLabel());
            }
        };
    }
}
